<?php
class ControllerModuleTopMenu extends Controller
{
    public function index()
    {
        $this->load->language('module/topMenu');
        $this->load->model('module/topMenu');
        $this->load->model('catalog/information');

        $links=array(
            array(
                'name'=>$this->language->get('text_home'),
                'url'=>HTTP_SERVER,
                'class'=>'top-menu-link',
            ),
        );
        if($informations=$this->model_catalog_information->getInformations()){
            foreach($informations as $info){
                if($info['top_menu']){
                    $links[]=array(
                        'name'=>$info['title'],
                        'url'=>$this->url->link('information/information', 'information_id=' . $info['information_id']),
                        'class'=>'top-menu-link',
                    );
                }
            }
        }

        $this->data['activeClass']='';
        $this->data['menuLinks']=$this->model_module_topMenu->getActiveLink($links);
        $this->template='default/template/module/TopMenu.tpl';

        $this->response->setOutput($this->render());
    }
}